package com.atguigu.lease.common.context;

/**
 * @BelongsProject: lease
 * @BelongsPackage: com.atguigu.lease.common.context
 * @Author: jiangyi
 * @CreateTime: 2025-08-22  16:34
 * @Description: TODO
 * @Version: 1.0
 */
public class LoginAppUserContext {

    // 创建LoginAppUser线程变量
    private static final ThreadLocal<LoginAppUser> userThreadLocal = new ThreadLocal<>();
    // 静态方法直接访问
    public static void setLoginAppUser(LoginAppUser loginAppUser ) {
        userThreadLocal.set(loginAppUser);
    }

    public static LoginAppUser getLoginAppUser() {
        return userThreadLocal.get();
    }

    public static void clear() {
        userThreadLocal.remove();
    }
}
